package com.usefullc.system.swagger;


import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.boot.context.properties.EnableConfigurationProperties;

import java.util.ArrayList;
import java.util.List;


@ConfigurationProperties(
        prefix = "usefullc.swagger"
)
@Data
@EnableConfigurationProperties
public class SwaggerProperties {
    private String apiHost = "usefullc.com";
    private String version = "v1.0";
    private String title = "api";
    private String description = "";
//    private String basePath = "com.usefullc";
    private Security security = new Security();
    private List<SwaggerGroup> groups = new ArrayList<>();

    /**
     * 授权相关
     * 现在暂时都放在header中
     * name可以是多个
     */
    @Data
    @NoArgsConstructor
    public class Security {
        private String[] name = {"token", "deviceId"};

//        public String[] getName() {
//            return name;
//        }
//
//        public void setName(String[] name) {
//            this.name = name;
//        }
    }

    @Data
    @NoArgsConstructor
    public static class SwaggerGroup {
        private String name;
        private String path;

    }

}
